package com.stan.core.mapper;

import com.stan.core.vo.Top10Session;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Top10Session的Mapper
 */
@Mapper
public interface Top10SessionMapper {
    // 进行批量插入
    @Insert({
            "<script>insert into t_top10_session (task_id,category_id,session_id,click_count) values " +
                    "<foreach collection='top10SessionList' item='session' index='index' separator=','>" +
                    "(#{session.taskId},#{session.categoryId},#{session.sessionId},#{session.clickCount})" +
                    "</foreach>" +
                    "</script>"
    })
    void insertList(@Param("top10SessionList") List<Top10Session> top10SessionList);

}
